package test;

import org.junit.Test;

import java.util.ArrayList;
import java.util.List;

public class 水题 {
    public List<String> stringSequence(String target) {
        char[] chars = target.toCharArray();
        List<String> res = new ArrayList<>();
        for (int i = 0; i < chars.length; i++) {
            char cur = 'a';
            String pre = target.substring(0, i);
            res.add(pre + cur);
            while (cur++ != chars[i]) {
                res.add(pre + cur);
            }
        }
        return res;
    }

    @Test
    public void test() {
        List<String> list = stringSequence("abc");
        System.out.println(list);
    }
}
